
use "Data/Refinitiv Fig 8", clear

gen year = year(IssueDate)

gen refund = 0
replace refund = 1 if CapitalType == "Refunding"
expand 2 if refund == 1, gen(refdupe)

replace AmountIssued = AmountIssued / 1000000

collapse (sum) AmountIssued, by(IssuerName year refdupe)

twoway histogram AmountIssued if refdupe == 0 & AmountIssued <= 10, frequency bin(20) || histogram AmountIssued if refdupe == 1 & AmountIssued <= 10, frequency graphregion(color(white)) xtitle("Bank Qualified Debt (Millions)") ytitle("Frequency") color(gs13) lcolor(black) lwidth(vthin) bin(20) legend(lab(1 "Total") lab(2 "Refundings"))

graph save "Figure 8", replace